#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
const ll M=1e9+7;
int n,k;
char s[505];
int lb[505],rb[505],lq[505],rq[505];
int lx[505],rx[505];
ll ans=0;
inline bool check(){
	int lbra=0,x=0;
	for(int i=1;i<=n;++i){
		if(s[i]=='*')
			x++;
		else
			x=0;
		if(x>k) return 0;
	}
	for(int l=1;l<=n;++l){
		lbra+=(s[l]=='(')-(s[l]==')');
		if(lbra<0) return 0;
	}
	if(lbra>0) return 0;
	char nx[505],cnt=0;
	for(int i=1;i<=n;++i){
		if(s[i]=='*'&&nx[cnt]!='*')
			nx[++cnt]='*';
		else
			nx[++cnt]=s[i];
	}
//	for(int i=1;i<=cnt;++i)
//		printf("%c",nx[i]);
//	puts("");
	for(int i=1;i<=cnt;++i){
		if(nx[i]=='*'){
			if(nx[i-1]=='('&&nx[i+1]==')') continue;
			if(nx[i-1]==')'&&nx[i+1]=='(') continue;
			int br=0;
			for(int j=i+1;j<=cnt;++j){
				if(nx[j]=='*'&&br==0) return 0;
				br+=(nx[j]=='(')-(nx[j]==')');
			}
		}
	}
	return 1;
}
inline void dfs(int x){
	if(x==n+1){
		if(check()){
			//printf("%s\n",s+1);
			ans=(ans+1)%M;
		}
		return;
	}
	if(s[x]!='?') dfs(x+1);
	s[x]='(';
	dfs(x+1);
	s[x]=')';
	dfs(x+1);
	s[x]='*';
	dfs(x+1);
	s[x]='?';
}
int main(){
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d%d%s",&n,&k,s+1);
	for(int i=1;i<=n;++i){
		if(s[i]=='(')
			lb[i]=lb[i-1]+1;
		else
			lb[i]=lb[i-1];
		if(s[i]=='?')
			lq[i]=lq[i-1]+1;
		else
			lq[i]=lq[i-1];
		if(s[i]=='*')
			lx[i]=lx[i-1]+1;
		else
			lx[i]=lx[i-1];
	}
	for(int i=n;i>=1;--i){
		if(s[i]==')')
			rb[i]=rb[i+1]+1;
		else
			rb[i]=rb[i+1];
		if(s[i]=='?')
			rq[i]=rq[i+1]+1;
		else
			rq[i]=rq[i+1];
		if(s[i]=='*')
			rx[i]=rx[i+1]+1;
		else
			rx[i]=rx[i+1];
	}
	if(lb[n]+lq[n]<rb[1]||rb[1]+lq[n]<lb[n]){
		printf("0\n");
		return 0;
	}
	dfs(1);
	printf("%lld\n",ans);
}
